<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=p7tyhmFy70HujfA7y8U4n2eUaXGr637G"></script>
    <script>
        var url = getUrlParam("coordinates");//根据URL地址栏中的参数名称获取对应的值
    </script>
    <title>根据经纬度定位</title>
    <style>
        html, body, #allmap{
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id='allmap'></div>
</div>
<script>
    // 百度地图API功能
    var map = new BMapGL.Map("allmap");
    map.centerAndZoom(new BMapGL.Point(116.331398,39.897445),17);
    map.enableScrollWheelZoom(true);

    // 用经纬度设置地图中心点
  /*  function theLocation(){*/

        /*var lng = url.split(",")[0];
        var lat = url.split(",")[1];*/


     /*   if (lng!=""&&lat!=""){
            map.clearOverlays();
           /!* var new_point = new BMapGL.Point(document.getElementById("lng").value,document.getElementById("lat").value);*!/
            var new_point = new BMapGL.Point(lng,lat);
            var marker = new BMapGL.Marker(new_point);  // 创建标注
            map.addOverlay(marker);              // 将标注添加到地图中
            map.panTo(new_point);
        } */
 /*       var lng = window.localStorage.getItem('lng');
        var lat = window.localStorage.getItem('lng');

     if (lng!=""&&lat!=""){
            map.clearOverlays();
           /!* var new_point = new BMapGL.Point(document.getElementById("lng").value,document.getElementById("lat").value);*!/
            var new_point = new BMapGL.Point(lng,lat);
            var marker = new BMapGL.Marker(new_point);  // 创建标注
            map.addOverlay(marker);              // 将标注添加到地图中
            map.panTo(new_point);
        }*/


   /* }*/
</script>
</body>
</html>